<include file="Public/header" />
<div id="main-content">

    <h2>Welcome</h2>

    <!-- End .shortcut-buttons-set -->
    <div class="clear"></div>
    <!-- End .clear -->
    <div class="content-box">
        <!-- Start Content Box -->
        <div class="content-box-header">
            <h3>首页宣传图管理</h3>
            <div class="clear"></div>
        </div>
        <!-- End .content-box-header -->
        <div class="content-box-content">
            <div class="tab-content default-tab" id="tab1">
                <!-- This is the target div. id must match the href of this div's tab -->
            </div>
            <table>
                <form action="{:U('Topic/homepageup')}" method="post" enctype="multipart/form-data">
                    <thead>
                    <div>上传宣传图: <input type="file" name="index"/></div>
                    <div><br/></div>
                    <div><input type="submit" class="button"/></div>
                    </thead>
            </table>
        </div>
        <!-- End #tab1 -->

    </div>
    <!-- End .content-box-content -->
</div>
<!-- End .content-box -->

<!-- End #main-content -->
</div>
<script>

    $(".delete").live("click",function(){
        var action = $(this).attr('value');
        var store_id = $(this).parent().parent().children(":first").children(":first").val();
        var parent = $(this).parent().parent();
        $.ajax({
            url: "{:U('Topic/deleteTopic');}",

            type: 'post',

            data:{"store_id":store_id, "action":action},

            dataType: 'json',

            timeout: 10000,

            error: function(){alert('出现错误了...刷新一下试试!');},

            success: function(data){

                if(data == 200){

                    parent.remove();
                }
            }
        });

    });
    $(".black").live("click",function(){
        var action = $(this).attr('value');
        var store_id = $(this).parent().parent().children(":first").children(":first").val();
        var parent = $(this).parent().parent();
        $.ajax({
            url: "{:U('Index/judge')}",

            type: 'post',

            data:{"store_id":store_id, "action":action},

            dataType: 'json',

            timeout: 10000,

            error: function(){alert('出现错误了...刷新一下试试!');},

            success: function(data){

                if(data == 200){

                    parent.remove();
                }
            }
        });

    });
</script>
</body>

</html>
